//
//  ViewController.m
//  tex
//
//  Created by 1 on 15/11/28.
//  Copyright © 2015年 itcast. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSLog(@"0");
    
    UIButton *button=[[UIButton alloc]init];
    [button setBackgroundColor:[UIColor redColor]];
//    button.frame=self.view.bounds;
    
    [self.view addSubview:button];
    
    button.frame=CGRectMake(20, 20, 199, 199);
    button.center=self.view.center;
//    button.center.x
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)viewWillAppear:(BOOL)animated
{
    NSLog(@"1");
}
- (void)viewDidAppear:(BOOL)animated
{

    NSLog(@"2");
}
@end
